package com.hui.server.controller;


import com.hui.server.entity.Menu;
import com.hui.server.service.MenuService;
import com.hui.server.util.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author hui
 * @since 2022-03-31
 */
@RestController
@RequestMapping("/cfg")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @ApiOperation(value = "通过用户ID查询菜单列表")
    @GetMapping("/menu")
    public Result<List<Menu>> getMenusByAdminId() {
        List<Menu> menuList = menuService.getMenusByAdminId();
        return Result.success(menuList);
    }
}
